<!DOCTYPE html>

<html>

<head>

  <title>H5测试工具</title>

  <meta name="viewport" content="width=device-width,initial-scale=1">

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta name="keywords" content="HTML,CSS,XML,JavaScript">

  <meta charset="utf-8" />

  <style type="text/css">

		body{

			font:14px/28px "微软雅黑";

		}

		.contact *:focus{outline :none;}

		.contact{

			width: 700px;

			height: auto;

			background: #f6f6f6;

			margin: 40px auto;

			padding: 10px;

		}

		.contact ul {

			width: 650px;

			margin: 0 auto;

		}

		.contact ul li{

			border-bottom: 1px solid #dfdfdf;

			list-style: none;

			padding: 12px;

		}

		.contact ul li label {

			width: 120px;

			display: inline-block;

			float: left;

		}

		.contact ul li input[type=text],.contact ul li input[type=password]{

			width: 220px;

			height: 25px;

			border :1px solid #aaa;

			padding: 3px 8px;

			border-radius: 5px;

		}

		.contact ul li input:focus{

			border-color: #c00;

			

		}

		.contact ul li input[type=text]{

			transition: padding .25s;

			-o-transition: padding  .25s;

			-moz-transition: padding  .25s;

			-webkit-transition: padding  .25s;

		}

		.contact ul li input[type=password]{

			transition: padding  .25s;

			-o-transition: padding  .25s;

			-moz-transition: padding  .25s;

			-webkit-transition: padding  .25s;

		}

		.contact ul li input:focus{

			padding-right: 70px;

		}

		.btn{

			position: relative;

			left: 300px;

		}

		.tips{

			color: rgba(0, 0, 0, 0.5);

			padding-left: 10px;

		}

		.tips_true,.tips_false{

			padding-left: 10px;

		}

		.tips_true{

			color: green;

		}

		.tips_false{

			color: red;

		}

  </style>

  <script type="text/javascript">

  	  function CheckUrl(str) { 
		var RegUrl = new RegExp(); 
		RegUrl.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");//jihua.cnblogs.com 
		if (!RegUrl.test(str)) { 
			return false; 
		} 
		return true; 
      } 
  
	  function checkna(){

			na=form1.payurl.value;

		  	if( na.length <1) {  	
				divname.innerHTML='<font class="tips_false">长度是不能为空</font>';
			}else{  
				divname.innerHTML='<font class="tips_true">输入正确</font>';
			}  

			if(!CheckUrl(na)){
				divname.innerHTML='<font class="tips_false">请输入正确的AuthCode</font>';
			}
		}
		 

	  function rdurl(){
		var url = document.getElementById('pay').val;
		window.location.href = form1.payurl.value;
	  }

  </script>

</head>

<body>

	<div class="contact" >

		<form name="form1" >

			<ul>

				<li>

					<label>AuthCode：</label>

					<input type="text" name="payurl" id="pay" placeholder="请输入AuthCode"  onblur="checkna()" required /><span class="tips" id="divname">长度不能为空</span>

				</li>

			</ul>

			<b class="btn"><input type="button" onclick="rdurl()" value="提交"/>

			<input type="reset" value="重置"/></b>

		</form>

	</div>

</body>

</html>



